<extend name="Public:common"/>
<block name="main">
    <div data-am-widget="tabs" class="am-tabs am-tabs-secondary" >
        <ul class="am-tabs-nav am-cf">
            <if condition="$type eq 1">
                <li class=""><a href="[data-tab-panel-0]">新建</a></li>
                <li class="am-active"><a href="[data-tab-panel-1]">收入</a></li>
                <li class=""><a href="[data-tab-panel-2]">支出</a></li>
            <elseif condition="$type eq 2"/>
                <li class=""><a href="[data-tab-panel-0]">新建</a></li>
                <li class=""><a href="[data-tab-panel-1]">收入</a></li>
                <li class="am-active"><a href="[data-tab-panel-2]">支出</a></li>
            <else/>
                <li class="am-active"><a href="[data-tab-panel-0]">新建</a></li>
                <li class=""><a href="[data-tab-panel-1]">收入</a></li>
                <li class=""><a href="[data-tab-panel-2]">支出</a></li>
            </if>
        </ul>
        <div class="am-tabs-bd">
            <if condition="$type eq 0">
                <div data-tab-panel-0 class="am-tab-panel am-active">
            <else/>
                <div data-tab-panel-0 class="am-tab-panel ">
            </if>
                <form class="am-form am-form-horizontal" method="post" data-am-validator="H5validation:false">
                    
                    <legend>新建分类</legend>
                    <div class="am-input-group">
                        <span class="am-input-group-label"><b>名称</b></span>
                        <input type="text" class="am-form-field" id="text-class" name="class_name" placeholder="输入分类名称">
                    </div>
                    <div><p></p></div>
                    <div class="am-input-group">
                        <span class="am-input-group-label"><b>类别</b></span>
                        <select id="select-type" class="am-form-field" name="class_type" >
                            <if condition="$ClassType eq 'in'">
                                <option value="1">收入</option>
                                <option value="2">支出</option>
                            <else/>
                                <option value="2">支出</option>
                                <option value="1">收入</option>
                            </if>
                        </select>
                    </div>
                    <p><input type="submit" class="am-btn am-btn-secondary am-btn-block" name="class_submit" value="新建"></p>
                    
                </form>
            </div>
            
            <if condition="$type eq 1">
                <div data-tab-panel-1 class="am-tab-panel am-active">
            <else/>
                <div data-tab-panel-1 class="am-tab-panel ">
            </if>
                
                <legend>收入分类</legend>
                <table class="am-table am-table-bordered am-table-radius am-table-striped am-table-centered am-text-sm">
                    <thead>
                        <tr>
                            <th bgcolor="#FFFFFF">分类名称</th>
                            <th bgcolor="#FFFFFF">收入</th>
                            <th bgcolor="#FFFFFF">操作</th>
                        </tr>
                    </thead>
                    <tbody class="">
                        <volist name="inMoneyClass" id="data">
                        <tr>
                            <td class="am-text-middle">{$data}</td>
                            <td class="am-text-middle">
                                <a href="<php>echo U("Home/Class/change?id=".$key);</php>" class="am-btn am-btn-success am-btn-xs">
                                    转为支出
                                </a>
                            </td>
                            <td class="am-text-middle">
                                <a href="<php>echo U("Home/Class/edit?id=".$key);</php>" class="am-btn am-btn-secondary am-btn-xs">
                                    编辑
                                </a>
                                <a href="javascript:void(0);" onclick="isDelete('<php>echo U("Home/Class/del?id=".$key);</php>')" class="am-btn am-btn-danger am-btn-xs">
                                    删除
                                </a>
                            </td>
                        </tr>
                        </volist>
                    </tbody>
                </table>
                
            </div>
            
            <if condition="$type eq 2">
                <div data-tab-panel-2 class="am-tab-panel am-active">
            <else/>
                <div data-tab-panel-2 class="am-tab-panel">
            </if>
                
                <legend>支出分类</legend>
                <table class="am-table am-table-bordered am-table-radius am-table-striped am-table-centered am-text-sm">
                    <thead>
                        <tr>
                            <th bgcolor="#FFFFFF">分类名称</th>
                            <th bgcolor="#FFFFFF">支出</th>
                            <th bgcolor="#FFFFFF">操作</th>
                        </tr>
                    </thead>
                    <tbody class="">
                        <volist name="outMoneyClass" id="data">
                        <tr>
                            <td class="am-text-middle">{$data}</td>
                            <td class="am-text-middle">
                                <a href="<php>echo U("Home/Class/change?id=".$key);</php>" class="am-btn am-btn-success am-btn-xs">
                                    转为收入
                                </a>
                            </td>
                            <td class="am-text-middle">
                                <a href="<php>echo U("Home/Class/edit?id=".$key);</php>" class="am-btn am-btn-secondary am-btn-xs">
                                    编辑
                                </a>
                                <a href="javascript:void(0);" onclick="isDelete('<php>echo U("Home/Class/del?id=".$key);</php>')" class="am-btn am-btn-danger am-btn-xs">
                                    删除
                                </a>
                            </td>
                        </tr>
                        </volist>
                    </tbody>
                </table>
                
            </div>
        </div>
    </div>
</block>